package threads

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
 * Bilibili API 的数据，用类的形式展示出来。
 *
 * @author ChatGPT
 */

@Serializable
data class MediaListResponse(
    val code: Int,
    val message: String,
    val data: List<MediaListData>
)

@Serializable
data class MediaListData(
    val attr: Int,
    val bv_id: String,
    val bvid: String,
    val cnt_info: MediaListCntInfo,
    val coin: MediaListCoin,
    val cover: String,
    val ctime: Int,
    val dimension: MediaListDimension,
    val duration: Int,
    val elec_open: Int,
    val fav_state: Int,
    val id: Int,
    val intro: String,
    val like_state: Int,
    val link: String,
    val page: Int,
    val pages: List<MediaListPage>,
    val pubtime: Int,
    val rights: MediaListRights,
    val short_link: String,
    val tid: Int,
    val title: String,
    val type: Int,
    val upper: MediaListUpper
)

@Serializable
data class MediaListCntInfo(
    val coin: Int,
    val collect: Int,
    val danmaku: Int,
    val play: Int,
    val reply: Int,
    val share: Int,
    @SerialName("thumb_down") val thumbDown: Int,
    @SerialName("thumb_up") val thumbUp: Int
)

@Serializable
data class MediaListCoin(
    @SerialName("coin_number") val coinNumber: Int,
    @SerialName("max_num") val maxNum: Int
)

@Serializable
data class MediaListDimension(
    val height: Int,
    val rotate: Int,
    val width: Int
)

@Serializable
data class MediaListPage(
    val dimension: MediaListDimension,
    val duration: Int,
    val from: String,
    val id: Int,
    val metas: List<MediaListMeta>,
    val page: Int,
    val title: String
)

@Serializable
data class MediaListMeta(
    val quality: Int,
    val size: Int
)

@Serializable
data class MediaListRights(
    val autoplay: Int,
    val bp: Int,
    val download: Int,
    val elec: Int,
    val hd5: Int,
    val movie: Int,
    @SerialName("no_background") val noBackground: Int,
    @SerialName("no_reprint") val noReprint: Int,
    val pay: Int,
    @SerialName("ugc_pay") val ugcPay: Int
)

@Serializable
data class MediaListUpper(
    val face: String,
    val followed: Int,
    val mid: Int,
    val name: String,
    @SerialName("vip_due_date") val vipDueDate: Long,
    @SerialName("vip_pay_type") val vipPayType: Int,
    @SerialName("vip_statue") val vipStatue: Int,
    @SerialName("vip_type") val vipType: Int
)
